package DAL;
/**hofit**/
import java.util.ArrayList;

public class Author_DAL {
	
	private int authorID;
	
	private String authorName;
	/**
	 * 
	 * @param array- list of user details
	 * Contractor - create Author
	 */
	public Author_DAL(ArrayList<String> array) {
		//convert array to Object of Author
		super();
		this.authorID = Integer.parseInt(array.get(0));
		this.authorName = array.get(1);
	}
	/**
	 * 
	 * @param authorID - id of the author
	 * @param authorName  name of the author
	 * Constructor - create Author
	 */
	public Author_DAL(int authorID, String authorName) {
		super();
		this.authorID = authorID;
		this.authorName = authorName;
	}
/**
 *
 * @return  get authorID
 */
	public int getAuthorID() {
		return authorID;
	}
/**
 * 
 * @param authorID
 * set the authorID
 */
	public void setAuthorID(int authorID) {
		this.authorID = authorID;
	}
/**
 * 
 * @return get the authorName
 */
	public String getAuthorName() {
		return authorName;
	}
/**
 * 
 * @param authorName
 * set the authorName
 */
	public void setAuthorName(String authorName) {
		this.authorName = authorName;
	}
	
	
	
/**
 * 
 * @param author
 * @return author object
 * convert Author class to array list
 */
	public ArrayList<String> authorToArray(Author_DAL author)
	{
		ArrayList<String> arrAuthor = new ArrayList<String>();
		arrAuthor.add(Integer.toString(author.authorID));
		arrAuthor.add(author.authorName);
		return arrAuthor;
	}

	
	
	

}
